﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes {
    import Engine.Helpers.*;

    public class ItemDefinitionBridge {

        protected var m_leftPart:String;
        protected var m_centerPart:String;
        protected var m_rightPart:String;
        protected var m_expansionFeedback:String;
        protected var m_validBuildExpansions:String;
        protected var m_grantedExpansionsOnPlace:String;
        protected var m_grantedExpansionType:String;
        protected var m_grantedExpansionsOnFinish:String;
        protected var m_minX:int;
        protected var m_maxX:int;
        protected var m_bridgeBoundary:Vector3;
        protected var m_targetSquare:Vector3;
        protected var m_bridgeparts:Array;
        protected var m_isPixelInsideAlphaThresholdOveride:uint = 128;
        protected var m_ghostAlpha:Number = 1;
        protected var m_ghostScale:Number = 1;
        protected var m_ghostXOffset:int = 0;
        protected var m_ghostYOffset:int = 0;

        public function init(_arg1:XML):void{
            var _local2:Array;
            var _local3:Array;
            var _local4:XML;
            var _local5:Object;
            this.m_leftPart = ((_arg1.leftPart.length())>0) ? String(_arg1.leftPart) : null;
            this.m_centerPart = ((_arg1.centerPart.length())>0) ? String(_arg1.centerPart) : null;
            this.m_rightPart = ((_arg1.rightPart.length())>0) ? String(_arg1.rightPart) : null;
            this.m_expansionFeedback = ((_arg1.expansionFeedback.length())>0) ? String(_arg1.expansionFeedback) : null;
            this.m_validBuildExpansions = ((_arg1.validbuildexpansions.length())>0) ? String(_arg1.validbuildexpansions) : null;
            this.m_grantedExpansionsOnPlace = ((_arg1.grantedExpansionsOnPlace.length())>0) ? String(_arg1.grantedExpansionsOnPlace) : null;
            this.m_grantedExpansionType = ((_arg1.grantedExpansionType.length())>0) ? String(_arg1.grantedExpansionType) : null;
            this.m_grantedExpansionsOnFinish = ((_arg1.grantedExpansionsOnFinish.length())>0) ? String(_arg1.grantedExpansionsOnFinish) : null;
            this.m_minX = _arg1.minX;
            this.m_maxX = _arg1.maxX;
            this.m_bridgeBoundary = new Vector3(0, 0, 0);
            if (_arg1.bridgeBoundary.length() > 0){
                _local2 = _arg1.bridgeBoundary.split("|");
                if (_local2.length == 2){
                    this.m_bridgeBoundary.x = int(_local2[0]);
                    this.m_bridgeBoundary.y = int(_local2[1]);
                };
            };
            this.m_targetSquare = new Vector3(0, 0, 0);
            if (_arg1.targetSquare.length() > 0){
                _local3 = _arg1.targetSquare.split("|");
                if (_local3.length == 2){
                    this.m_targetSquare.x = int(_local3[0]);
                    this.m_targetSquare.y = int(_local3[1]);
                };
            };
            this.m_bridgeparts = new Array();
            if (_arg1.hasOwnProperty("bridgeparts")){
                for each (_local4 in _arg1.bridgeparts.part) {
                    _local5 = {
                        type:String(_local4.@type),
                        x:int(_local4.@x),
                        y:int(_local4.@y)
                    };
                    this.m_bridgeparts.push(_local5);
                };
            };
            this.m_ghostAlpha = 1;
            if (_arg1.ghostAlpha.length() > 0){
                this.m_ghostAlpha = Number((Number(_arg1.ghostAlpha) / 100));
            };
            if ((((this.m_ghostAlpha < 0)) || ((this.m_ghostAlpha > 1)))){
                this.m_ghostAlpha = 1;
            };
            this.m_ghostScale = 1;
            if (_arg1.ghostScale.length() > 0){
                this.m_ghostScale = Number((Number(_arg1.ghostScale) / 100));
            };
            this.m_ghostXOffset = int(_arg1.ghostXOffset);
            this.m_ghostYOffset = int(_arg1.ghostYOffset);
        }
        public function get leftPart():String{
            return (this.m_leftPart);
        }
        public function get centerPart():String{
            return (this.m_centerPart);
        }
        public function get rightPart():String{
            return (this.m_rightPart);
        }
        public function get expansionFeedback():String{
            return (this.m_expansionFeedback);
        }
        public function get validBuildExpansions():String{
            return (this.m_validBuildExpansions);
        }
        public function get grantedExpansionsOnPlace():String{
            return (this.m_grantedExpansionsOnPlace);
        }
        public function get grantedExpansionType():String{
            return (this.m_grantedExpansionType);
        }
        public function get grantedExpansionsOnFinish():String{
            return (this.m_grantedExpansionsOnFinish);
        }
        public function get minX():int{
            return (this.m_minX);
        }
        public function get maxX():int{
            return (this.m_maxX);
        }
        public function get bridgeBoundary():Vector3{
            return (this.m_bridgeBoundary);
        }
        public function get targetSquare():Vector3{
            return (this.m_targetSquare);
        }
        public function get bridgeParts():Array{
            return (this.m_bridgeparts);
        }
        public function get ghostAlpha():Number{
            return (this.m_ghostAlpha);
        }
        public function get ghostScale():Number{
            return (this.m_ghostScale);
        }
        public function get ghostXOffset():int{
            return (this.m_ghostXOffset);
        }
        public function get ghostYOffset():int{
            return (this.m_ghostYOffset);
        }

    }
}//package Classes 
